package day14_io.作业14;

import java.io.*;

//分别使用文件流和缓冲流复制一个长度大于100MB的视频文件，并观察效率的差异.G:\数加视频\day13_Io\day13_IO06.mp4
public class 作业3copy {
    public static void main(String[] args) throws Exception{
//        FileInputStream fis = new FileInputStream("G:\\数加视频\\day13_Io\\day13_IO06.mp4");
//        FileOutputStream fos = new FileOutputStream("G:\\数加视频\\day13_Io\\csw.mp4");
//        byte[] b = new byte[1024];
//        for (byte b1 : b) {
//            int i;
//            while ((i=fis.read(b))!=-1){
//                fos.write(i);
//            }
//        }
//        fis.close();
//        fos.close();
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("G:\\数加视频\\day13_Io\\day13_IO06.mp4"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("G:\\数加视频\\day13_Io\\csw3.mp4"));
        byte[] b = new byte[1024];
        for (byte b1 : b) {
            int i;
            while ((i=bis.read(b))!=-1){
                bos.write(b,0,i);
            }
        }
        bis.close();
        bos.close();
    }
}
